function Sn = Sn(x,y)      
    sum=0;
    n=length(x);
    h=x(3)-x(1);
    for k=1:2:n-2
        sum=sum+y(k)+4*y(k+1)+y(k+2);
    end
    Sn = h/6*sum;
 end
